<?php
$dbh=new PDO('mysql:host=localhost;dbname=gaofei','root','root');
$sql="select * from movie";
$arr=$dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC);
foreach($arr as $key=>$value)
{
    ob_start();
    file_put_contents($value['id'].'.html',ob_get_clean());
    include "moban.php";
}
?>